---
title: Delete hearing location
summary: Removes a hearing location after confirming it is not currently in use.
status: draft
owner: SAIF Documentation Pipeline
last_reviewed: 2026-08-21
library: SAIF.Application.Claim.Legal
reference_type: embedded
operation_id: OP-LGL-012
trigger: clsHearingLocationManager.DeleteLocation() invoked
---

# Delete hearing location

This operation removes a hearing location code after delegating an in-use check to the business tier, blocking the deletion when the location is currently referenced.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-LGL-012 |
| **Trigger** | `clsHearingLocationManager.DeleteLocation()` invoked |
| **Inputs** | Location code |
| **Outputs** | Location removed, or blocked with an error message |
| **Primary components** | `clsHearingLocationManager.DeleteLocation` |
| **Entry point** | `SAIF.Application.Claim.Legal\clsHearingLocationManager.vb` |

## Steps

1. `DeleteLocation()` is invoked for a target location code. The available location codes are populated from the cached [HEARING_LOCATION_CODE](../database-tables.md#hearing_location_code) lookup ([SQL-011](../sql/SQL-011-location-code-list-hearing-location.md)).
2. Delegate the "in-use" check to `clsHearingLocation.CanDeleteLocation`.

   > **Origin**: delegates to `SAIF.Business.Claim.Legal` (see [operations and processes](../../saif-business-claim-legal/operations-processes.md)) — the internal step sequence of `clsHearingLocation.CanDeleteLocation` was not traced in this run's Stage 1 analysis; this callout is inferred/best-effort.*
3. If the check fails (location is in use) ([BR-LGL-015](../business-rules.md#br-lgl-015-a-hearing-location-cannot-be-deleted-while-in-use)):
   - On failure: block the deletion with `"Error: this location is in use and cannot be deleted."`
4. Otherwise: delete the location.

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start([DeleteLocation invoked]) --> Check[clsHearingLocation.CanDeleteLocation]
	Check --> InUse{In use?}
	InUse -->|Yes| Blocked([Blocked: location in use])
	InUse -->|No| Delete[Delete location]
	Delete --> EndOk([Done])
```

## Failure and edge-case behavior

- Location currently in use: deletion blocked with a user-facing error message; no exception is thrown to the caller.

> **Note:** Statements marked with `*` were inferred from code structure, naming
> conventions, or contextual evidence where direct confirmation was not available
> in source artifacts.

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [SQL catalog](../sql/index.md)
- [Database tables](../database-tables.md)

## Sources
- `SAIF.Application.Claim.Legal\clsHearingLocationManager.vb`
